import { getAnalytics, logEvent } from "firebase/analytics";

/**
 * 进行埋点
 * @param key string 埋点key
 * @param key - login - 登录(/pages/login/index)
 * @param key - register - 注册(/pages/register/index)
 * @param key - purchase - 详情(/pages/goods/details) - 立即购买
 * @param key - addCar - 详情(/pages/goods/details) - 加入购物车
 * @param key - createOrder - 确认订单(/pages/pay/confirm-order) - 提交
 * @param key - payOrder - 收银台(/pages/pay/index) - 支付
 * @param key - carCreateOrder - 购物车(/pages/cart/index) - 结算
 * @param key - searchGoods - 首页(/pages/home/index) - 搜索
 */
export const burialPoint = (key, params) => {
	const analytics = getAnalytics();
	logEvent(analytics, key, params);
};